package com.situ.mall.web.controller;

import com.situ.mall.common.entity.OrderDetail;
import com.situ.mall.common.service.IOrderAddressService;
import com.situ.mall.common.service.IOrderInfoService;
import com.situ.mall.common.vo.TableVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/")
public class UcOrderController {
    @Autowired
    private IOrderAddressService orderAddressService;
    @Autowired
    private IOrderInfoService orderInfoService;

    @GetMapping("/uc-order")
    public String page() {
        return "uc-order";
    }

    @GetMapping("/uc-order-detail")
    public String page1() {
        return "uc-order-detail";
    }

    //查询订单并且分页
    @GetMapping("/uc-order/list")
    @ResponseBody
    public TableVO page(String status, Integer limit, Integer page, String keyword) {
        return orderAddressService.select(status, limit, page, keyword);
    }

    //改变订单状态为已签收
    @GetMapping("/uc-order/confirm")
    public String confirm(Integer id){
        orderInfoService.confirm(id);
        return "/uc-order";
    }

}
